import java.awt.Graphics;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;


public class ImageBackgroundPanel extends JPanel {
    private BufferedImage image;

    ImageBackgroundPanel(final BufferedImage image) {
        this.setImage(image);
    }

    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(getImage(), 0, 0, this);
    }

	public void setImage(BufferedImage image) {
		this.image = image;
	}

	public BufferedImage getImage() {
		return image;
	}
}
